public class Solution1189 {
    public int maxNumberOfBalloons(String text) {
        int[] f=new int[26];
        for (char c : text.toCharArray()) {
            f[c-'a']++;
        }
        int min=f['b'-'a'];
        min=Math.min(min,f['a'-'a']);
        min=Math.min(min,f['l'-'a']/2);
        min=Math.min(min,f['o'-'a']/2);
        min=Math.min(min,f['n'-'a']);
        return min;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1189().maxNumberOfBalloons("nlaebolko"));
    }
}
